package com.bw.mapper;

import com.bw.bean.vo;
import com.bw.bean.vo1;
import com.bw.bean.vo2;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface vomapper {
    @Select("select  hour(create_time)'name'\n" +
            "     ,count(*)'value' from payment_info\n" +
            "          group by hour(create_time)\n" +
            "order by hour(create_time);")
    List<vo> cx1();
@Select("select  bs.source_site'name',\n" +
        "        sum(oi.final_amount)'amount1',\n" +
        "        count(distinct  oi.user_id)'count1',\n" +
        "        count(oi.user_id)'count2'\n" +
        "        from order_info oi\n" +
        "left join  order_detail od on oi.id = od.order_id\n" +
        "left join course_info ci on ci.id = od.course_id\n" +
        "left join chapter_info c on ci.id = c.course_id\n" +
        "left join video_info vi on c.id = vi.chapter_id\n" +
        "left join base_source bs on vi.video_source_id = bs.id\n" +
        "group by bs.source_site;")
    List<vo1> cx2();
@Select("select  count(user_id) from order_info where date(create_time)='2021-04-23';\n")
    double cx3();
@Select("select  ci.course_name'name',\n" +
        "        sum(oi.final_amount)'amount1'\n" +
        "        from order_info oi\n" +
        "left join order_detail od on oi.id = od.order_id\n" +
        "left join course_info ci on od.course_id = ci.id\n" +
        "group by ci.course_name;")
    List<vo2> cx4();
}
